<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="./adminHead.jsp"%>
<html>
<head>
    <title>添加图书</title>

    <style type="text/css">
        .mySpan{
            font-size: 20px;
        }
        .myText{
            height: 50px;
            width: 400px;
            font-size: 15px;
        }
        .myBt{
            height: 50px;
            width: 100px;
        }
    </style>
</head>
<body>
    <div class="col-md-9">
        <div class="row text-center" style="font-size: 20px">
            <c:if test="${tips != null}">
                <div class="alert alert-success" role="alert">
                    <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
                    <span class="sr-only">Yes:</span>${tips}
                </div>
            </c:if>
            <c:if test="${error != null}">
                <div class="alert alert-danger" role="alert">
                    <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                    <span class="sr-only">Error:</span>${error}
                </div>
            </c:if>
        </div>
<%--        上传图片，form添加enctype属性，让上传的数据变为二进制--%>
        <form action="${pageContext.request.contextPath}/jsp/admin/book.do?method=add" method="post" enctype="multipart/form-data">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <span class="mySpan">编号：</span>
                        <input type="text" class="form-control myText" id="bookCode" name="bookCode" placeholder="请输入编号" value="" required/>
                    </div>
                    <div class="form-group">
                        <span class="mySpan">书名：</span>
                        <input type="text" class="form-control myText" id="bookName" name="bookName" placeholder="请输入书名" value="" required/>
                    </div>
                    <div class="form-group">
                        <span class="mySpan">作者：</span>
                        <input type="text" class="form-control myText" id="bookAuthor" name="bookAuthor" placeholder="请输入作者" value="" required/>
                    </div>
                    <div class="form-group">
                        <span class="mySpan">出版社：</span>
                        <input type="text" class="form-control myText" id="bookPress" name="bookPress" placeholder="请输入出版社" value="" required/>
                    </div>
                    <div class="form-group">
                        <span class="mySpan">书本图片：</span>
                        <input type="file" class="btn btn-lg btn-primary" id="bookPicture" name="bookPicture"/>
                    </div>
                    <div class="form-group">
                        <span class="mySpan">单价(元)：</span>
                        <input type="text" class="form-control myText" id="bookPrice" name="bookPrice" placeholder="请输入单价(元)" value="" required/>
                    </div>
                    <div class="form-group">
                        <span class="mySpan">数量(个)：</span>
                        <input type="text" class="form-control myText" id="bookQuantity" name="bookQuantity" placeholder="请输入数量(个)" value="" required/>
                    </div>
                </div>
                <div class="col-md-6">

                </div>
            </div>
            <div class="row">
                <div class="col-md-4">
                    <div class="col-md-6">
                        <input type="submit" class="btn btn-lg btn-primary myBt" value="添加"/>
                    </div>
                    <div class="col-md-6">
                        <input type="reset" class="btn btn-lg btn-primary myBt" value="重置"/>
                    </div>
                </div>

            </div>
        </form>

</div>
</body>
</html>
